import random

fall = open("总名单.txt", "r", encoding="UTF-8")
all = fall.read()
namelist = all.split('\n')
s = len(namelist)          # 名单长度
sed = 0                    # 点过人数
remain = 0                 # 剩余人数
print("-----计科1813、1814总人数:%d-----" % s)
a = '1'
while a == '1':
    temp = random.choice(namelist)
    namelist.remove(temp)         # 点过名的不会再被点到
    print("随机点名中:%s" % temp)   # 输出点到名的同学的名字
    sed += 1
    remain = s - sed
    print("已随机点名人数:%d,未点到人数:%d" % (sed, remain))

    f = open("新名单.txt", "w", encoding="UTF-8")   # 存储新的文件
    for line in namelist:
        f.write(line + '\n')
    f.close()

    if not namelist:
        print("点名结束")
        break
    else:
        # print(namelist)              # 列出还没点到名的名单
        print("-"*31)
        a = input("是否继续点名[1继续/0结束]")
        while a != '1' and a != '0':
            a = input("请输入正确选项[0或1]")
